//
//  JWAnimationManager.h
//  JWBrowser
//
//  Created by Dejun Liu on 15/6/11.
//  Copyright (c) 2015年 JW. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UIView+JHChainableAnimations.h"
#import <objc/runtime.h>
#import "JHKeyframeAnimation.h"

typedef enum
{
    JWAnimationLocation_Top,      //视图显示在顶部
    JWAnimationLocation_Right,    //视图显示到右边
    JWAnimationLocation_Left,     //视图显示到左边
    JWAnimationLocation_Bottom,   //视图显示到底部
    JWAnimationLocation_Center,   //视图显示到中间
    JWAnimationLocation_APoint,   //视图移动到一个点
} JWAnimationLocation;

typedef void(^BlockResponse)();    //回调函数

@interface JWAnimationManager : NSObject

/**
 *  弹出的视图，宽度和window一致，默认只使用window的宽度，屏幕旋转不做适配
 */
@property (nonatomic) BOOL isPopViewAdaptWindowWidth;

/**
 *  弹出的视图，高度和window一致，默认只使用window的高度，屏幕旋转不做适配
 */
@property (nonatomic) BOOL isPopViewAdaptWindowHeight;

/**
 *  弹出一个视图，到window上面
 *
 *  @param view          需要有动画的视图
 *  @param startLocation 从什么地方变化下来
 *  @param location      最终停在什么地方
 */
- (void)popView:(UIView *)view startLocation:(JWAnimationLocation) startLocation endLocation:(JWAnimationLocation) location tapMaskBlock:(BlockResponse) block;

/**
 *  移除一个视图从PopView上面
 *
 *  @param view 需要移除的视图
 */
- (void)removeViewFromPopView:(UIView *) view toLocation:(JWAnimationLocation) endLocation complationBlock:(BlockResponse) complation;

@end
